  tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#4F46E5',
                        success: '#10B981',
                        dark: '#1F2937',
                        neutral: '#F3F4F6'
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
          document.addEventListener('DOMContentLoaded', function() {
            // 验证用户登录状态
            const users = JSON.parse(localStorage.getItem('registeredUsers')) || [];
            const loginEmail = localStorage.getItem('currentLoginEmail');
            
            if (!loginEmail) {
                window.location.href = 'index.html';
                return;
            }
            
            // 获取当前用户信息
            const currentUser = users.find(user => user.email === loginEmail);
            if (currentUser) {
                // 填充用户信息
                document.getElementById('user-display-name').textContent = currentUser.name;
                document.getElementById('verified-email').textContent = `${currentUser.email} 已验证`;
                
                // 更新头像
                if (currentUser.avatar) {
                    document.getElementById('header-avatar').src = currentUser.avatar;
                }
            } else {
                localStorage.removeItem('currentLoginEmail');
                window.location.href = 'index.html';
            }
            
            // 移动端菜单切换
            const mobileMenuButton = document.getElementById('mobile-menu-button');
            const mobileMenu = document.getElementById('mobile-menu');
            
            mobileMenuButton.addEventListener('click', function() {
                mobileMenu.classList.toggle('hidden');
            });
            
            // 模态框控制
            const modals = {
                'change-password': document.getElementById('change-password-modal'),
                'change-email': document.getElementById('change-email-modal'),
                'login-history': document.getElementById('login-history-modal')
            };
            
            // 打开模态框
            document.getElementById('change-password-btn').addEventListener('click', function() {
                openModal('change-password');
            });
            
            document.getElementById('change-email-btn').addEventListener('click', function() {
                openModal('change-email');
            });
            
            document.getElementById('view-login-history').addEventListener('click', function() {
                openModal('login-history');
            });
            
            // 关闭模态框
            document.querySelectorAll('.close-modal, .cancel-modal').forEach(button => {
                button.addEventListener('click', function() {
                    closeAllModals();
                });
            });
            
            // 点击模态框外部关闭
            Object.values(modals).forEach(modal => {
                modal.addEventListener('click', function(e) {
                    if (e.target === this) {
                        closeAllModals();
                    }
                });
            });
            
            function openModal(modalId) {
                closeAllModals();
                modals[modalId].classList.remove('hidden');
                // 重置表单
                const form = modals[modalId].querySelector('form');
                if (form) form.reset();
            }
            
            function closeAllModals() {
                Object.values(modals).forEach(modal => {
                    modal.classList.add('hidden');
                });
            }
            
            // 发送验证码
            let countdown = 0;
            document.getElementById('send-verification-code').addEventListener('click', function() {
                const emailInput = document.getElementById('new-email');
                const email = emailInput.value;
                
                if (!email || !validateEmail(email)) {
                    alert('请输入有效的邮箱地址');
                    emailInput.focus();
                    return;
                }
                
                // 模拟发送验证码
                if (countdown === 0) {
                    countdown = 60;
                    updateCountdown();
                    
                    // 实际应用中这里会发送请求到服务器
                    console.log(`发送验证码到邮箱: ${email}`);
                    showToast('验证码已发送，请查收');
                }
            });
            
            function updateCountdown() {
                const button = document.getElementById('send-verification-code');
                if (countdown > 0) {
                    button.disabled = true;
                    button.textContent = `重新发送(${countdown})`;
                    countdown--;
                    setTimeout(updateCountdown, 1000);
                } else {
                    button.disabled = false;
                    button.textContent = '获取验证码';
                }
            }
            
            // 更改密码提交
            document.getElementById('submit-password-change').addEventListener('click', function() {
                const currentPassword = document.getElementById('current-password').value;
                const newPassword = document.getElementById('new-password').value;
                const confirmPassword = document.getElementById('confirm-password').value;
                
                // 验证当前密码
                if (currentPassword !== currentUser.password) {
                    alert('当前密码不正确');
                    return;
                }
                
                // 验证新密码
                if (newPassword.length < 8) {
                    alert('密码长度至少8位');
                    return;
                }
                
                if (!/\d/.test(newPassword) || !/[a-zA-Z]/.test(newPassword)) {
                    alert('密码必须包含字母和数字');
                    return;
                }
                
                if (newPassword !== confirmPassword) {
                    alert('两次输入的密码不一致');
                    return;
                }
                
                // 更新密码
                currentUser.password = newPassword;
                const userIndex = users.findIndex(u => u.email === loginEmail);
                if (userIndex !== -1) {
                    users[userIndex] = currentUser;
                    localStorage.setItem('registeredUsers', JSON.stringify(users));
                    closeAllModals();
                    showToast('密码更新成功');
                }
            });
            
            // 更改邮箱提交
            document.getElementById('submit-email-change').addEventListener('click', function() {
                const newEmail = document.getElementById('new-email').value;
                const verificationCode = document.getElementById('email-verification-code').value;
                const password = document.getElementById('password-for-email').value;
                
                // 验证邮箱
                if (!validateEmail(newEmail)) {
                    alert('请输入有效的邮箱地址');
                    return;
                }
                
                // 验证验证码 (实际应用中应该验证服务器发送的验证码)
                if (!verificationCode) {
                    alert('请输入验证码');
                    return;
                }
                
                // 验证密码
                if (password !== currentUser.password) {
                    alert('密码不正确');
                    return;
                }
                
                // 检查邮箱是否已被使用
                if (users.some(u => u.email === newEmail && u.email !== loginEmail)) {
                    alert('该邮箱已被注册');
                    return;
                }
                
                // 更新邮箱
                const oldEmail = currentUser.email;
                currentUser.email = newEmail;
                
                const userIndex = users.findIndex(u => u.email === oldEmail);
                if (userIndex !== -1) {
                    users[userIndex] = currentUser;
                    localStorage.setItem('registeredUsers', JSON.stringify(users));
                    localStorage.setItem('currentLoginEmail', newEmail);
                    
                    document.getElementById('verified-email').textContent = `${newEmail} 已验证`;
                    
                    closeAllModals();
                    showToast('邮箱更新成功');
                }
            });
            
            // 退出登录
            document.getElementById('logout-btn').addEventListener('click', function() {
                if (confirm('确定要退出登录吗？')) {
                    localStorage.removeItem('currentLoginEmail');
                    window.location.href = 'index.html';
                }
            });
            
            // 显示提示消息
            function showToast(message) {
                const toast = document.getElementById('success-toast');
                document.getElementById('toast-message').textContent = message;
                
                // 显示toast
                toast.classList.remove('translate-y-20', 'opacity-0');
                toast.classList.add('translate-y-0', 'opacity-100');
                
                // 3秒后隐藏
                setTimeout(() => {
                    toast.classList.remove('translate-y-0', 'opacity-100');
                    toast.classList.add('translate-y-20', 'opacity-0');
                }, 3000);
            }
            
            // 邮箱验证函数
            function validateEmail(email) {
                const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
                return re.test(email);
            }
        });